<page-header [action]="phActionTpl">
  <ng-template #phActionTpl>
    <button (click)="createdrugCompany()" nz-button nzType="primary">新建</button>
  </ng-template>
</page-header>
<nz-card>
  <sf mode="search" [schema]="searchSchema" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf>
  <st #st [data]="url" [columns]="columns" [res]="{ reName: { list: 'items' ,total: 'totalCount'} }"
    [req]="{reName: { pi: 'skipCount' ,ps: 'maxResultCount'}}"></st>
</nz-card>

<div>
  <nz-drawer #drawer [nzBodyStyle]="{ overflow: 'auto'}" [nzMaskClosable]="false" [nzWidth]="550"
    [nzVisible]="editVisible" [nzTitle]="detailTitle" [nzFooter]="footerTpl" [nzContent]="drugSupplierContent"
    (nzOnClose)="close()">

    <ng-template #drugSupplierContent>
      <form nz-form [formGroup]="editForm">
        <div nz-row [nzGutter]="8">
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label class="form-label label-info">编码</nz-form-label>
              <nz-form-control autoErrorTip>
                <input nz-input formControlName="code" placeholder="厂商编码" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="8">
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label label-info">名称</nz-form-label>
              <nz-form-control autoErrorTip>
                <input nz-input formControlName="name" placeholder="厂商名称" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="8">
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label label-info">类型</nz-form-label>
              <nz-form-control autoErrorTip>
                <nz-select formControlName="type" nzAllowClear>
                  <nz-option *ngFor="let type of typeList" [nzValue]="type.value" [nzLabel]="type.label"></nz-option>
                </nz-select>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="8">
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label class="form-label label-info">电话</nz-form-label>
              <nz-form-control autoErrorTip>
                <input nz-input formControlName="tel" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="8">
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label class="form-label label-info">地址</nz-form-label>
              <nz-form-control autoErrorTip>
                <input nz-input formControlName="address" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="8">
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label class="form-label label-info">使用</nz-form-label>
              <nz-form-control>
                <label nz-checkbox formControlName="isValid"></label>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
      </form>
    </ng-template>

    <ng-template #footerTpl>
      <div style="float: right">
        <button nz-button class="mr8" (click)="close()">取消</button>
        <button nz-button nzType="primary" (click)="save()">保存</button>
      </div>
    </ng-template>
  </nz-drawer>
</div>
